#pragma once

#include "OpenCVImg.h"
#include <Eigen/Dense>

using namespace Eigen;

class CImgRegistration
{
public:
	CImgRegistration(void);
	virtual ~CImgRegistration(void);
	//Equal to CvGetAffineTransform()???
	void ComputeAffineTransform(CImgRegistration* img1);
	//
	void LoadImageForDisplay(char* strFileName, bool bColor, float fScaleFactor=0.25f);
	//
	inline int GetNumFeaturePts() {return m_iNumFeaturePts;}
	inline void SetNumFeaturePts(int iNumPts) {m_iNumFeaturePts = iNumPts;}
	inline int GetNumNeighborSize() {return m_iNumNeighborSize;}
	inline void SetNumNeighborSize(int iNeighborSize) {m_iNumNeighborSize = iNeighborSize;}
	COpenCVImg* GetImgPointer() {return m_pImg;}
	COpenCVImg* GetScaledImgPointer() {return m_pScaledImg;}
	inline std::vector<CvPoint2D32f>& GetArrCorners() {return m_arrCorners;}
	inline bool isTransOnly() {return m_bTranslationOnly;}
	inline TransFormData_2D& Get2DTransform() {return m_2DTransform;}
	void SaveFeaturePts(char* strFileName);
	
protected:
	COpenCVImg* m_pImg;
	COpenCVImg* m_pScaledImg;	
	std::vector<CvPoint2D32f> m_arrCorners;
	int m_iNumFeaturePts;
	int m_iNumNeighborSize;
	float m_fScaleFactor;//for scaled image
	float m_fThresholdRot;//threshold for rotation angle
	bool m_bTranslationOnly;//bool to show only translation
	//rigid transform params
	TransFormData_2D m_2DTransform;
};

